package com.company.app.action;

import net.sourceforge.stripes.action.ActionBean;
import net.sourceforge.stripes.action.ActionBeanContext;
import net.sourceforge.stripes.action.DefaultHandler;
import net.sourceforge.stripes.action.ForwardResolution;
import net.sourceforge.stripes.action.Resolution;

/**
 * The Class HelloWorldAction.
 */
public class HelloWorldAction implements ActionBean {
	
	private static final String VIEW = "/WEB-INF/jsp/HelloWorld.jsp";
	
	/** The context. */
	private ActionBeanContext context;
	
	/** The msg. */
	private String msg;
	
	/**
	 * Say hello.
	 *
	 * @return the resolution
	 */
	@DefaultHandler  
    public Resolution sayHello() {  
		this.msg = "Hello, Stripes!";  
		return new ForwardResolution(VIEW);  
    }  

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * net.sourceforge.stripes.action.ActionBean#setContext(net.sourceforge.
	 * stripes.action.ActionBeanContext)
	 */
	@Override
	public void setContext(ActionBeanContext context) {
		this.context=context;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see net.sourceforge.stripes.action.ActionBean#getContext()
	 */
	@Override
	public ActionBeanContext getContext() {
		return this.context;
	}

	/**
	 * Gets the msg.
	 *
	 * @return the msg
	 */
	public String getMsg() {
		return msg;
	}

	/**
	 * Sets the msg.
	 *
	 * @param msg the new msg
	 */
	public void setMsg(String msg) {
		this.msg = msg;
	}
	
}
